package com.hutou.chuangke.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.hutou.chuangke.R;
import com.hutou.chuangke.uitl.ActivityManager;

/**
 * Created by tyhdark on 2017/3/22.
 * 登录注册选择界面
 */
public class LoginRegisterActivity extends AppCompatActivity implements View.OnClickListener {
    TextView right_tv;
    ImageView back_image;
    Button login_bt,register_bt;
    ImageView wechatImageview,qqImageview,weiboImageview;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loginregister);
        ActivityManager.getInstatnce().addActivity(this);//统一管理activity
        initView();
    }

    private void initView() {
        back_image = (ImageView) findViewById(R.id.back_image);
        back_image.setOnClickListener(this);
        right_tv = (TextView) findViewById(R.id.right_tv);
        right_tv.setVisibility(View.GONE);
        login_bt = (Button) findViewById(R.id.login_bt);
        login_bt.setOnClickListener(this);
        register_bt = (Button) findViewById(R.id.register_bt);
        register_bt.setOnClickListener(this);
        wechatImageview = (ImageView) findViewById(R.id.wechat_imageview);
        wechatImageview.setOnClickListener(this);
        weiboImageview = (ImageView) findViewById(R.id.weibo_imageview);
        weiboImageview.setOnClickListener(this);
        qqImageview = (ImageView) findViewById(R.id.qq_imageview);
        qqImageview.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(v == login_bt){
            Intent intent = new Intent(LoginRegisterActivity.this,LoginActivity.class);
            startActivity(intent);
            finish();
        }else if(v == register_bt){
            Intent intent = new Intent(LoginRegisterActivity.this,RegisterActivity.class);
            startActivity(intent);
        } if(v == wechatImageview){

        }else if(v == weiboImageview){

        }else if(v == qqImageview){
            Intent intent = new Intent(LoginRegisterActivity.this,VideoViewActivity.class);
            startActivity(intent);
        }else if(v == back_image){
            Intent intent = new Intent(LoginRegisterActivity.this,LoginRegisterActivity.class);
            startActivity(intent);
            finish();
        }
    }
}
